import React from "react"
import { Link, browserHistory } from 'react-router'
import { BackTop,Modal } from 'antd'
import { Map,Marker} from 'react-amap'
class MapHtml extends React.Component{
	constructor(props){
		super(props)
		this.state={
			center: { longitude: 120.452004, latitude: 36.082171}
		}
		this.toolEvents = {
      created: (tool) => {
        this.tool = tool;
      }
    }
    this.mapPlugins = ['ToolBar'];
    this.mapCenter = {longitude: 120.445228, latitude: 36.076126};
    this.markerPosition = {longitude: 120.445228, latitude:36.076126};
	}

    hideModal =()=>{
        this.props.handleHide();
	}

	render(){
		return (
		<Modal
			key={this.props.visible}
			visible={this.props.visible}
		  okText="确定"
		  cancelText="返回" onOk={this.hideModal.bind(this)} onCancel={this.hideModal.bind(this)}
			width={ 800 }
			 wrapClassName="MapModal"
		   // style={{width: '100%', height: '400px'}}
			>
			<div style={{width: '100%', height: '400px'}}>
				<Map amapkey={'788e08def03f95c670944fe2c78fa76f'}
					plugins={this.mapPlugins}
				 center={this.mapCenter}
				 zoom={16}>
				 <Marker position={this.markerPosition} />
				 </Map>
			</div>
		</Modal>

		)
	}
}
export default MapHtml;
